package 算法.leetcode.offer;

/**
 * @author lchenglong
 * @date 2022/3/19
 */
public class Offer58_II {

    public static void main(String[] args) {
        Offer58_II instance = new Offer58_II();
        String res = instance.reverseLeftWords("abcdefg", 2);
        System.out.println(res);
    }
    public String reverseLeftWords(String s, int n) {
        if (s == null ||n>s.length())return s;
        String sub1 = s.substring(0,n);
        String sub2 = s.substring(n);
        return sub2 + sub1;
    }
}
